const mongoose = require('mongoose');
require('mongoose-long')(mongoose);
let schemaTypes = mongoose.Schema.Types;

//电压schema
let dicVoltageSchema = new mongoose.Schema({
    _id: {
        type: schemaTypes.ObjectId,
        require: true // 不可为空约束
	},
	//编码格式
	did:{
		type: String,
		require: true,
		default: "UTF8"
	},
    //名称
    value: {
		type: String,
        require: true
    },
    //代码
    label: {
        type: Number,
        require: true
    },
    //创建时间
    creatime: {
        type: schemaTypes.Long,
        require: true
    },
    //更新时间
    chantime: {
        type: schemaTypes.Long,
        require: true
    },
    //图标
    picture: {
        type: String,
        require: true
    }
}, {
    versionKey: false
});

//电压模型
let DicVoltageModel = mongoose.model('DicVoltageModel', dicVoltageSchema, 'dic_voltage');
module.exports = DicVoltageModel;